package com.bawei.room.table
import androidx.room.TypeConverter
import com.blankj.utilcode.util.GsonUtils


/**
 * 数据库字段转换操作
 */
class CustomTypeConverters {

    @TypeConverter
    fun arrayListToString(list: ArrayList<String>): String {
        return GsonUtils.toJson(list)
    }

    fun stringToArrayList(json: String): ArrayList<String> {
        return GsonUtils.fromJson(json,  ArrayList::class.java)  as ArrayList<String>
    }

}
